package cn.ncupyh.soft;

public class GameTest {
    public static void main(String[] args) {

//    创建对象
        Game_gedou r1 = new Game_gedou("乔峰",100,"男");
        Game_gedou r2 = new Game_gedou("鸠摩智",100,"男");

//        展示个人信息
        r1.showface();
        r2.showface();

//开始格斗
        while(true){
//        A攻击B
            r1.attack(r2);
            if(r2.getBlood() == 0){
                System.out.println(r1.getName() + "KO了" + r2.getName());
                break;
            }

//            B 攻击A
            r2.attack(r1);
            if(r1.getBlood() == 0){
                System.out.println(r2.getName() + "KO了" + r1.getName());
                break;
            }
        }
    }

}
